home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2006 November
/
PCWorld_2006-11_cd.bin
/
domacnost a kancelar
/
findgraph
/
fgraph.exe
/
{app}
/
UserModels
/
models.h
< prev
next >
Wrap
C/C++ Source or Header
|
2004-10-06
|
3KB
|
96 lines
#if !defined(AFX_MODELS_H_)
#define AFX_MODELS_H_
// Models.h
typedef void (*PToFuncName )(LPTSTR lpszName, int nLen);
typedef void (*PToFuncForm )(LPTSTR lpszName, int nLen);
typedef int (*PToFuncCalc )(double *pfParams, int nParams, double u, double *px, double *py);
typedef int (*PToFuncCheck)(double *pfParams, int nParams);
typedef int (*PToFuncDefau)(double *pfParams, int nParams, double *px, double *py, BOOL bNormed);
#define VAL_NO 0.
struct FuncDesc
{
int m_nId;
PToFuncName m_pFuncName ;
PToFuncForm m_pFuncForm ;
PToFuncCalc m_pFuncCalc ;
PToFuncCheck m_pFuncCheck;
PToFuncDefau m_pFuncDefau;
};
FuncDesc *PFittingDescInId (int nId);
int FittingModelsList (int nIdList, int *pnIds, int *pNum);
/////////////////////////////////////////////////////////////////////////////////////////////////
#define X_MIN px[0]
#define X_MAX px[1]
#define X_MED px[2]
#define Y_MIN py[0]
#define Y_MAX py[1]
#define Y_MED py[2]
#define A_PARAM pfParams[0]
#define B_PARAM pfParams[1]
#define C_PARAM pfParams[2]
#define D_PARAM pfParams[3]
#define G_PARAM pfParams[4]
#define H_PARAM pfParams[5]
#define K_PARAM pfParams[6]
#define L_PARAM pfParams[7]
#define M_PARAM pfParams[8]
// Check fitting parameters
int Only1Param(double *pfParams, int nParams);
int OnlyBParam(double *pfParams, int nParams);
int Only2Param(double *pfParams, int nParams);
int Only3Param(double *pfParams, int nParams);
int Only4Param(double *pfParams, int nParams);
int Only5Param(double *pfParams, int nParams);
int OnlyACDPrm(double *pfParams, int nParams);
//////////////////////////////////////////////////////////////////////////////////////////////////
// Fitting models
#define DEFINE_MODEL(model) void model##_Name(LPTSTR lpszName, int nLen);\
void model##_Form(LPTSTR lpszName, int nLen);\
int model##_Calc(double *pfParams, int nParams, double u, double *px, double *py);\
int model##_Check(double *pfParams, int nParams);\
int model##_Defau(double *pfParams, int nParams, double *px, double *py, BOOL bNormed);
#define MODELS_LIST_START() static FuncDesc g_ListFunc[] = {
#define MODELS_LIST_END() -1, NULL, NULL, NULL, NULL, NULL};
#define MODELS_LIST_ADD(id, model) id, model##_Name, model##_Form, model##_Calc, model##_Check, model##_Defau,
DEFINE_MODEL(Poly)
DEFINE_MODEL(S2Bind)
DEFINE_MODEL(S2Comp)
DEFINE_MODEL(E2Decay)
DEFINE_MODEL(E2Assoc)
DEFINE_MODEL(D2Biph)
DEFINE_MODEL(DAssym)
DEFINE_MODEL(L2Biph)
DEFINE_MODEL(S2Gauss)
DEFINE_MODEL(S2Loren)
/*
void S2Bind_Name (LPTSTR lpszName, int nLen);
void S2Bind_Form (LPTSTR lpszName, int nLen);
int S2Bind_Calc (double *pfParams, int nParams, double u, double *px, double *py);
int S2Bind_Check(double *pfParams, int nParams);
int S2Bind_Defau(double *pfParams, int nParams, double *px, double *py, BOOL bNormed);
*/
#endif // !defined(AFX_MODELS_H_)